from selenium.webdriver.common.by import By

from common.Utils import BlogDriver


#问卷调查首页测试用例
class BlogList:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "http://8.155.1.153:8081/user/login"
        self.driver = BlogDriver.driver
        self.driver.get(self.url)

    #测试首页(登陆情况下)
    def ListTestByLogin(self):
        #测试问卷调查标题是否存在
        self.driver.find_element(By.CSS_SELECTOR,"#sk-layout > div > div > section > div > main > div > div.ant-page-header.ant-pro-page-container-warp-page-header.ant-pro-page-container-warp-page-header.ant-page-header-has-breadcrumb.ant-page-header-ghost.ant-page-header-compact > div.ant-page-header-heading > div > span")
        #测试问卷调查内容是否存在
        self.driver.find_element(By.CSS_SELECTOR,"#sk-layout > div > div > section > div > main > div > div.ant-page-header.ant-pro-page-container-warp-page-header.ant-pro-page-container-warp-page-header.ant-page-header-has-breadcrumb.ant-page-header-ghost.ant-page-header-compact > div.ant-page-header-content > div > div > div > div > div > div.content___1eLtZ > div.contentTitle___Yu-cR")
        #测试按钮是否存在
        self.driver.find_element(By.CSS_SELECTOR,"#rc-tabs-4-tab-exam")

        #个人信息-检查昵称是否存在
        self.driver.find_element(By.XPATH,"//span[text()='admin1' or contains(text(), '用户')]")

        #添加屏幕截图
        BlogDriver.getScreenShot()


    #测试首页(未登录情况下)




